<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Bootstrap 101 Template</title>
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
  </head>
  <body>
    <div style="padding: 100px 400px 30px;">
    <form class="bs-example bs-example-form" role="form">
        <div class="input-group">
            <span class="input-group-addon">用户名</span>
            <input type="text" id="username" name="username" class="form-control" placeholder="请输入用户名"/>
        </div>
        <br>
		<div class="input-group">
			<span class="input-group-addon">密码</span>
			<input type="text" id="password" name="password" class="form-control" placeholder="请输入密码"/>
		</div>
		
		<div style="margin:0 auto;width:200px;"> 
		<input class="submit" id="btn" type="button" onclick="login()" value="登录" /> 
		</div> 
    </form>
</div>   
<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<!-- 加载 Bootstrap 的所有 JavaScript 插件。你也可以根据需要只加载单个插件。 -->
<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!--  eddd -->
<script type="text/javascript">
	function login(){
		// get username and password  备注：alert打印，console.log打印到控制台
		//alert($("input#username").val(), $("input#password").val());
        console.log($("input#username").val(), $("input#password").val());
		　　var url="XXXX/lianjiedizhi";
		　　var username0=$("#username").val();  //#代表id  .代表class   input代表name
		　　var password0=$("#password").val();
		　　$.post(url,{username:username0,password:password0},function(r){
			   if(r.success){
				  console.log("系统提示","添加成功","info");
			   }else{
				  console.log("系统提示","添加失败","error");
			   }
			});
		
	}
	
	
	
	
</script>
</body>
</html>